<script setup lang="ts">
import { useRouter } from "vue-router";

const router = useRouter();

const token = localStorage.getItem("token");

if (!token) {
  router.push("/login");
}
</script>

<template>
  <div>
    <router-view v-slot="{ Component }">
      <KeepAlive :max="10" :exclude="['detail']">
        <component :is="Component" />
      </KeepAlive>
    </router-view>
  </div>
</template>

<style scoped></style>
